package v3.originator;

import originator.CollerOriginator;
import v3.caretaker.GestionDefaire;
import v3.memento.CollerMementoV3;
import v3.memento.MementoV3;


public class CollerOriginatorV3 implements OriginatorV3 {


	public CollerOriginatorV3(CollerOriginator _coller, GestionDefaire _gestion) {
		super();
		this._coller = _coller;
		this._gestion = _gestion;
	}

	private originator.CollerOriginator _coller;

	private GestionDefaire _gestion;

	@Override
	public void execute() {
		MementoV3 m = new CollerMementoV3(this);
		_gestion.sauvegarder(m);
		_coller.execute();		
	}

	@Override
	public void setMemento(MementoV3 m) {
		((CollerOriginatorV3)m.getCommand()).execute();
	}

}
